package com.weimob.mcloud.wechatwork.customer.export;

import com.alibaba.fastjson.JSON;
import com.weimob.artemis.client.consumer.model.MessageResult;
import com.weimob.mcloud.wechatwork.customer.mq.CorpExternalUserConsumer;
import com.weimob.mcloud.wechatwork.customer.service.user.service.CustomerMsgBenchMarkExport;
import com.weimob.mcloud.wechatwork.customer.service.user.utils.SoaResponseUtil;
import com.weimob.soa.common.response.SoaResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author yu liu  2021/10/25 17:42
 * Description
 * Version 1.0.0
 **/
@Slf4j
@Service
public class CustomerMsgBenchMarkExportImpl implements CustomerMsgBenchMarkExport {
    @Autowired
    CorpExternalUserConsumer corpExternalUserConsumer;
    @Override
    public SoaResponse<Boolean, ?> changeCorpExternaluser(String request) {
        MessageResult messageResult = JSON.parseObject(request, MessageResult.class);
        corpExternalUserConsumer.changeCorpExternaluser(messageResult);
        return SoaResponseUtil.ok(Boolean.TRUE);
    }
}
